package CoteClient;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class CellRender extends JLabel implements ListCellRenderer {

	
    public CellRender() {
        setOpaque(false);
    }

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

        setText(value.toString());

    	String[] string = value.toString().split(" ");

        if (string[0].equals("+"))
        	setForeground(Color.GREEN);
        else if (string[0].equals("#")) 
        	setForeground(Color.ORANGE);
        else 
        	setForeground(Color.RED);
        	
        return this;
    }
}